package com.doudou.collection.orm.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
/**
 * @ClassName BlogDTO<br>
 * @Description 博客文章发布DTO类<br>
 * @Author 薛思唯<br>
 * @Date 2023/6/22 23:02<br>
 * @Version 1.0<br>
 */
@Data
public class BlogDTO implements Serializable {

    /**
     * 文章标题
     */
    @NotNull(message = "请提交文章标题")
    @Pattern(regexp = "^[a-zA-Z\\u4e00-\\u9fa5]{2,10}$",
            message = "文章标题必须是2~10长度的字符组成，且不允许使用标点符号")
    @ApiModelProperty(value = "文章标题", required = true)
    private String title;
    /**
     * 附带图片
     */
    @NotNull(message = "请提交文章图片")
    @ApiModelProperty(value = "文章图片", required = true)
    private String images;
    /**
     * 发布的内容
     */
    @NotNull(message = "请提交文章内容")
    @ApiModelProperty(value = "文章内容", required = true)
    private String content;
    /**
     * 作者ID
     */
    private Long userId;
    /**
     * 发布地点
     */
    @NotNull(message = "请选择发布地点")
    @ApiModelProperty(value = "发布地点", required = true)
    private String articleLocation;
    /**
     * 分类ID
     */
    @NotNull(message = "请选择文章分类")
    @ApiModelProperty(value = "文章分类", required = true)
    private Integer categoriesId;
    /**
     * 文章标签
     */
    @Pattern(regexp = "^(#([\\u4e00-\\u9fa5a-zA-Z]{1,10})){0,5}(?!#)$",
            message = "文章标签必须为#开头且由1~10长度的中英文字符组成,最多添加5个标签")
    @ApiModelProperty(value ="文章标签")
    private String tags;


}
